
<?
//获取指定数据:
//$belong 所属板块
//$sort_by:排序项,例："nid,listorder desc"
//number:获取数据数量,0则无限
//publish是必须

function get_detail_list($belong,$sortby,$number)
{

  if($number){$limit_str=" limit ".$number;}
  else{$limit_str="";}

  $sort_str=" order by ".$sortby." ".$sortorder;
  
    global $table_Prefix;

//设置需要搜索的表格的前缀后缀
    $table_Suffix = "detail";
    $table        = $table_Prefix . $table_Suffix;
//设置需要搜索的表格的前缀后缀

 
 
     $sqlstr="SELECT * FROM ".$table." where belong = '".$belong."' and publish = '1' ".$sort_str.$limit_str;

        $detail_list = mysql_query($sqlstr);
        while ($row = mysql_fetch_array($detail_list)) {
  
  $detail['nid'][]           = $row['nid'];
  $detail['mid'][]           = $row['mid'];
  $detail['name'][]          = $row['name'];
  $detail['title'][]         = $row['title'];
  $detail['keyword'][]       = $row['keyword'];
  $detail['description'][]   = $row['description'];
  $detail['model'][]         = $row['model'];
  $detail['introduce'][]     = $row['introduce'];
  //$detail['detail'][]        = $row['detail'];
  $detail['stock'][]         = $row['stock'];
  $detail['price'][]         = $row['price'];
  $detail['memberprice'][]   = $row['memberprice'];
  $detail['discountprice'][] = $row['discountprice'];
  $detail['local'][]         = $row['local'];
  $detail['listorder'][]     = $row['listorder'];
  $detail['hotsale'][]       = $row['hotsale'];
  $detail['discount'][]      = $row['discount'];
  $detail['recommend'][]     = $row['recommend'];
  $detail['soldout'][]       = $row['soldout'];
  $detail['publish'][]       = $row['publish'];
  $detail['onsaletime'][]    = $row['onsaletime'];
  $detail['inputtime'][]     = $row['inputtime'];
  $detail['modifytime'][]    = $row['modifytime'];
  $detail['banner'][]        = $row['banner'];
  $detail['icon'][]          = $row['icon'];
  $detail['image1'][]        = $row['image1'];
  $detail['image2'][]        = $row['image2'];
  $detail['image3'][]        = $row['image3'];
  $detail['image4'][]        = $row['image4'];
  $detail['image5'][]        = $row['image5'];
  $detail['extend_img'][]    = $row['extend_img'];
  $detail['clickrate'][]     = $row['clickrate'];
  $detail['storage'][]       = $row['storage'];
  $detail['attachment'][]    = $row['attachment'];
  $detail['vip_term'][]      = $row['vip_term'];
  $detail['zan'][]           = $row['zan'];
  $detail['url'][]           = $row['url'];
}



    return $detail;
}



?>

